package com.gh.inheritance;

/**
 * @author M.G
 * @create 2022-12-08 16:03
 */
public class ManagerTest {

    public static void main(String[] args) {

        //经理数组、
        Manager[] managers = new Manager[10];
        //子类转父类没问题
        Employee[] employees = managers;
        //这么写就是错误的，这里试图创建一个不存在的实例字段对象，会对子类对象造成破坏
        //报错ArrayStoreException错误
        //employees[0] = new Employee("想直接变成经理的员工1", 10000, 2022, 12, 8);

        System.out.println(employees[0]);

    }
}
